package com.mby.utils;

import com.mby.entity.Result;

/**
 * Created by noah on 2018/4/15.
 */
public class ResultUtil {
    public static Result success(Object object){
        Result<Object> result = new Result<>();
        result.setCode(0);
        result.setMsg("success");
        result.setData(object);
        return result;
    }

    public static Result success(){
        Result result = new Result();
        result.setCode(0);
        result.setMsg("success");
        return result;
    }

    public static Result error(Integer code, String msg){
        Result<Object> result = new Result<>();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
